#!/bin/bash

# Note to programmers. this code can be tested BEFORE it is uploaded
# to the web site. the  call "./index.cgi Strings" does the same
# thing as http://awkcookbook.info/?Strings.

[ -n "$1" ] && export QUERY_STRING="$1"

tinytim() { 
		pages $1  | format | highlight
}
pages() { 
		gawk -f etc/assemble.awk content/config.txt \
		        content/*/*.txt content/*/*.awk \
				themes/$1/theme.txt 
}
format()  { 
		gawk -f lib/tinytim.awk -f lib/plugins.awk - 
}
highlight() {
	sed 's/^<pre>/<script type="syntaxhighlighter" class="brush: cpp"><![CDATA[/' |
	sed ' s/^<\/pre>/<\/script>/'
}

#tinytim wink
#tinytim auklet
tinytim trendygreen

